<html>
<head>
	<base href="<?php echo $this->config->item('base_url'); ?>">
	<link rel="stylesheet" href="style_admin.css" type="text/css" media="screen"/>
	<link rel="stylesheet" href="main_admin.css" type="text/css" media="screen"/>
	<link type="text/css" href="jquery_ui/css/ui-lightness/jquery-ui-1.8.4.custom.css" rel="stylesheet" />	
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="jquery_ui/js/jquery-ui-1.8.4.custom.min.js"></script>
	<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
</head>
<body>
<script type="text/javascript" >
	tinyMCE.init({
		mode : "textareas",
		theme : "simple"   //(n.b. no trailing comma, this will be critical as you experiment later)
	});
</script >
	<style type="text/css">
	#sortable, #sortable2, #sortable3 { list-style-type: none; margin: 0; padding: 0;margin-right: 10px;clear:both; }
	#sortable li, #sortable2 li, #sortable3 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em;cursor:move; }
	</style>
	
	<script type="text/javascript">
	$(function() {
		$("#sortable").sortable({
			placeholder: 'ui-state-highlight',
			update: function (event, ui) {
				//alert(ui);
				var z = $(this).sortable('toArray');
				var order = "";
				for (i = 0; i < z.length; i++)
				{
					order += z[i] + ";";
				}
				//alert(order);
				<?php //echo ajax_link('random_number', $update, TRUE, 'content-box-content', FALSE); ?>
				ajax_click('update_order', { order: order}, true, 'content-box-content', false, false);
			}
		});
	});

	function ajax_click (func, data, showprogress, target, closebox)
    {
	    var showecho = false;
	    //alert(data['tags']);
	    var buffer = $('#'+target).html();
	   // alert(buffer);
    	var url = '<?php echo site_url('ajax'); ?>' + '/' + func;
    	if (showprogress)
    	{
        	if (target.length > 0)
        	{
    			$('#'+target).html('<img src="images/ajax-loader.gif" />');
        	}
    	}
		$.post(url, data,
		function(data_out)
		{
			if (target.length > 0)
			{
				if (!closebox)
				{
					if (!showecho)
					{
						window.location.reload();	
					}
					else
					{
						$('#'+target).html(data_out);
					}
				}
				else
				{
					$('#'+target).hide('slow');
				}
			}
		});
    }
	</script>
<div id="topmenu">
Opennewspaper Admin
</div>
<!--
<div class="demo">

<ul id="sortable1" class="connectedSortable">
	<li class="ui-state-default">Item 1</li>
	<li class="ui-state-default">Item 2</li>
	<li class="ui-state-default">Item 3</li>
	<li class="ui-state-default">Item 4</li>
	<li class="ui-state-default">Item 5</li>
</ul>

<ul id="sortable2" class="connectedSortable">
	<li class="ui-state-highlight">Item 1</li>
	<li class="ui-state-highlight">Item 2</li>
	<li class="ui-state-highlight">Item 3</li>
	<li class="ui-state-highlight">Item 4</li>
	<li class="ui-state-highlight">Item 5</li>
</ul>
<ul id="sortable3" class="connectedSortable">
	<li class="ui-state-default">Item 1</li>
	<li class="ui-state-default">Item 2</li>
	<li class="ui-state-default">Item 3</li>
	<li class="ui-state-default">Item 4</li>
	<li class="ui-state-default">Item 5</li>
</ul>
</div>
-->